package com.yangrui.app.util;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.Getter;

import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
@Getter
public class GuavaTemplate {

    private Cache<String,Object> tenMinuteCache = CacheBuilder.newBuilder().
            initialCapacity(10)
            .maximumSize(100)
            .concurrencyLevel(5)
            .expireAfterWrite(600, TimeUnit.SECONDS)
            .recordStats()
            .build();
}
